package com.dg.dto;

import com.dg.pojo.User;
import lombok.Data;

@Data
public class UserTransferDto {

    // id
    private Integer key;
    // 用户
    private String label;
    // 是否冻结
    private Boolean disabled = false;

    public static UserTransferDto adapter(User user){
        UserTransferDto dto = new UserTransferDto();
        dto.setKey(user.getId());
        dto.setDisabled(user.getStatus() == 1 ? false : true);
        dto.setLabel(dto.getDisabled() ? user.getUsername()+"(冻结)" : user.getUsername());
        return dto;
    }

}
